package com.user;

import com.card.*;

public class Player 
{
	private String name;
	private Card[] cardSet;
	
	private final static int SIZE_OF_CARD_SET = 4;

	public Player(String name) 
	{
		if(name == null)
		{
			this.name = "";
		}
		else
		{
			this.name = name;
		}
		
		this.cardSet = new Card[SIZE_OF_CARD_SET];
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public void getCardSetFrom(CardDeck cardDeck)
	{
		for(int i = 0; i < Player.SIZE_OF_CARD_SET ; i++)
		{
			this.cardSet[i] = cardDeck.getRandomCard();
		}
	}
	
	public void cut(int index, Card newCard)
	{
		this.cardSet[index] = newCard;
	}
	
	public Card[] getCardSet()
	{
		return this.cardSet;
	}
	
	public void returnCardSetTo(CardDeck cardDeck)
	{
		for(int i = 0; i < Player.SIZE_OF_CARD_SET ; i++)
		{
			cardDeck.retrieveCard(this.cardSet[i]);
			this.cardSet[i] = null;
		}
	}

	public void bet()
	{
		
	}
	
	public void cut(CardDeck cardDek)
	{
		
	}	
}